///
/// Override the DataBind to populate the DataGrid. Call base.DataBind()
/// and then populate the ASP DataGrid.
///
public override void DataBind()
{
// Call the base.DataBind()
base.DataBind();
if (!this.Page.IsPostBack)
{
System.Web.UI.WebControls.DataGrid myDataGrid;
myDataGrid = ((System.Web.UI.WebControls.DataGrid)(this.FindControlRecursively("myDataGrid")));
// If DataGrid is found then populate it
if (!(myDataGrid == null))
{
string whereStr = null;
// Create orderBy clause
BaseClasses.Data.OrderBy ob = null;
// Set page index and size
int pageIndex = 0;
int pageSize = 1000;
// Set the DataSource of the DataGrid
myDataGrid.DataSource = ${${Table Name}ClassName}.GetDataTable(whereStr, ob, pageIndex, pageSize);
myDataGrid.DataBind();
}
}
}
|